package com.yaya.spring.ioc.annotation;

import org.springframework.stereotype.Component;

//使用@Component可以让当前这个类的对象成为spring容器中的bean
//bean的名字默认就是类名首字母小写
//同时也可以自己指定名字:@Component("car")
@Component
public class Car {
	private String name;
	private double price;
	
	public Car(){
		
	}
	
	public Car(double price, String name) {
		this.price = price;
		this.name = name;
	}
	
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
